#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>

int main()
{
    char arr1[11] = { 0 };
    char arr2[15] = { 0 };
    char* p = arr2;
    gets(arr1);
    int len = strlen(arr1);
    if (len <= 3)
    {
        strncpy(arr2, arr1, 3);
        printf("%s\n", arr2);
    }
    else if (len > 3 && len <= 6)
    {
        int i = 0;
        int j = 0;
        for (i = 0; i < 1; i++)
        {
            strncpy(arr2 + 15 - 3, arr1 + len - 3, 3);
            arr2[15 - 4] = ',';
            j += 3;
        }
        while (*p != ',')
        {
            p++;
        }
        strncpy(p - len + 3, arr1, len - 3);
        printf("%s\n", p - len + 3);
    }
    else if (len > 6)
    {
        int i = 0;
        int j = 0;
        for (i = 0; i < 2; i++)
        {
            if (i == 0)//153920529
            {
                strncpy(arr2 + 15 - 3 - 1, arr1 + len - 3, 3);
            }
            else if (i > 0)
            {
                strncpy(arr2 + 15 - 3 - 1 - 1 - j, arr1 + len - 3 - j, 3);
            }
            arr2[15 - 4 - 1 - 4 * i] = ',';
            j += 3;
        }
        p = arr2;
        while (*p != ',')
        {
            p++;
        }
        strncpy(p - len + 6, arr1, len - 6);
        printf("%s\n", p - len + 6);
    }
    return 0;
}